<template>
	<view class="Since">
		<statusBar />
		<!-- 设置 -->
		<view @tap="leftIndex" class="nav">
			<image src="../../static/setup/jiantou.png" mode=""></image>
			<view>自提订单</view>
		</view>
		<!-- 滚动待处理 -->
		<view class="rolling"><u-tabs name="cate_name" :bar-height="10" active-color="#FDC345" :list="list" :is-scroll="true" :current="current" @change="change"></u-tabs></view>
		<view class="Child"><Mention :SinceTime="SinceTime"></Mention></view>
	</view>
</template>
<script>
import { mapActions, mapState } from 'vuex';
import { toast } from '@/utils/toast';
import request from '@/utils/request';
import statusBar from '../../components/statusBar/statusBar.vue';
import Mention from './components/mention.vue';
export default {
	data() {
		return {
			current: 1,
			list: [
				{
					name: '全部'
				},
				{
					name: '60分钟'
				},
				{
					name: '今日'
				},
				{
					name: '明日'
				},
				{
					name: '3天'
				},
				{
					name: '7天'
				},
				{
					name: '15天'
				}
			],
			SinceTime: []
		};
	},
	components: {
		statusBar,
		Mention
	},
	created() {
		this.order();
	},
	methods: {
		leftIndex() {
			uni.navigateBack({
				delta: 1
			});
		},
		change(index) {
			this.current = index;
			this.order();
		},
		// 接口
		order() {
			uni.showLoading({
				title: '加载中',
				duration: 2000
			});
			request('/merchant/order/raise-order', 'GET', {
				timeType:this.current,
			}).then(res => {
				if (res.data.code == 1) {
					this.SinceTime = res.data;
					console.log(this.SinceTime, 111);
					setTimeout(() => {
						uni.hideLoading();
					}, 500);
				}
				try {
					this.SinceTime = JSON.parse(res.data);
				} catch (e) {
					this.SinceTime = res.data;
				}
			});
		}
	}
};
</script>
<style lang="scss" scoped>
.Since {
	.nav {
		display: flex;
		align-items: center;
		padding: 50upx 30upx 31upx 30upx;
		background: $bg1-color;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 9999;

		image {
			width: 27upx;
			height: 30upx;
			display: flex;
		}
		& > view {
			font-size: 34upx;
			font-family: Source Han Sans CN;
			font-weight: bold;
			color: $bg2-color;
			margin-left: 30upx;
		}
	}
	.rolling {
		padding-top: 100upx;
		background: $bg1-color;
		/deep/.u-tab-item {
			color: $bg3-color !important;
		}
	}
	.Child {
		background: $bg1-color;
		// margin-top: 24upx;
		width: 93%;
		margin: 0 auto;
	}
}
</style>
